import request from "axios";

/**
 * 请求教师数据
 * @param {} pageSize
 * @param {String} pageNum
 * @param {String} delete
 * @param {String} name
 * @param {String} tel
 * @returns 
 */
export function requestTeacherData(data) {
    return request({
        url: "/teacher/list",
        method: "post",
        data
    })
}

/**
 * 请求教师数据通过id
 * @param {Int} id 
 * @returns 
 */
export function requestTeacherDataById(params){
    return request({
        url:"/teacher/selectTeacherById",
        method:"get",
        params:params
    })
}

/**
 * 请求添加教师
 * @param {Object} Teacher 
 * @returns 
 */
export function requestAddTeacher(data) {
    return request({
        url: "/teacher/addTeacher",
        method: "post",
        data
    })
}

/**
 * 请求修改教师
 * @param {Object} Teacher 
 * @returns 
 */
export function requestUpdateTeacher(data) {
    return request({
        url: "/teacher/updateTeacher",
        method: "put",
        data
    })
}

/**
 * 请求删除教师（修改用户删除状态）
 * @param {Int} id 
 * @param {Int} isDelete 
 * @returns 
 */
export function requestBatchUpdateTeacherIsDelete(params){
    return request({
        url: "/teacher/batchUpdateTeacherIsDelete",
        method: "delete",
        params:params
    })
}
/**
 * 请求彻底删除教师
 * @param {Int} id 
 * @returns 
 */
export function requestBatchDeleteTeacherById(params){
    return request({
        url: "/teacher/batchDeleteTeacherById",
        method: "delete",
        params:params
    })
}

/**
 * 重置密码
 * @param {Int} id
 * @param {String} password
 * @returns 
 */
export function requestResetPwd(data){
    return request({
        url: "/teacher/resetTeacherPwd",
        method: "put",
        data
    })
}


/**
 * 查询所有用户
 * @returns 
 */
export function requestTeacherAll(){
    return request({
        url: "/teacher/all",
        method: "get",
    })
}

/**
 * 查询所有角色
 * @returns 
 */
export function requestRoleAll(){
    return request({
        url: "/role/selectAllRole",
        method: "get",
    })
}

/**
 * 用户绑定角色
 * @param {Int} teacherId 
 * @param {Array} roleIds 
 * @returns 
 */
export function requestTeacherBoundRoles(params){
    return request({
        url: "/teacher/teacherBoundRoles",
        method: "post",
        params:params
    })
}
/**
 * 通过教师编号查询教师已绑定角色
 * @param {Int} teacherId 
 * @returns 
 */
export function requestQueryTeacherBoundRoles(params){
    return request({
        url: "/teacher/queryTeacherBoundRoles",
        method: "get",
        params:params
    })
}
